﻿@using Utry.Framework.Mvc
@model Utry.CI.Models.CheckItemListModel
@{
    ViewBag.Title = "需求bug提交物列表";
}

<div style="margin-top:60px;">
<form name="form1" method="post" action="@Url.Action("checklist", "checkitem")" enctype="multipart/form-data" >

 @Html.JPartial("_Notifications")
<div class="table-toolbar">

    <div class="btn-group">
          <a id="sample_editable_1_new" class="btn btn-sm btn-success"  href="@Url.Action("additemtoplan","checkitem")" >
             添加计划 <i class="icon-plus"></i>
          </a>
    </div>

    <div class="btn-group">
       @Html.DropDownList("PlanId", Model.PlanSelectItem, new { @class = "select2 form-control" })
    </div>

     <div class="btn-group">
           	<input type="text" name="DemandCode" id="DemandCode" placeholder="需求(bug)编号" value="@Model.DemandCode" class="form-control" style="width:180px;"/>
      </div>

     <div class="btn-group">
            <input type="text" name="datefrom" id="datefrom" placeholder="开始时间"  value="@Model.datefrom" class="form-control datefrom" style="width:130px;"/> 
      </div>

     <div class="btn-group">
			<input type="text" name="dateto" id="dateto" placeholder="结束时间" value="@Model.dateto" class="form-control dateto" style="width:130px;"/>        
      </div>

     <div class="btn-group">
            <button type="button" class="btn btn-sm btn-success" onclick="query()"><i class="icon-search"></i></button>      </div>
   
                      
</div>

  <table class="table table-striped table-bordered table-hover" id="checklist">
        <thead>
          <tr>
            <th>UTMP版本号</th>
            <th>计划编号</th>
            <th>需求编号</th>
            <th>资源列表</th>
            <th>提交物</th>
            <th>验证方法</th>
            <th>部署注意事项</th>
            <th>UTMP状态</th>
            <th>提交时间</th>
            <th>开发人员</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>

         @foreach (var item in Model.ItemList)
         {
          <tr>
           <td>@item.versionnum </td>
            <td>@item.PlanCode </td>
            <td>@item.DemandCode  </td>
            <td>
               @item.CodeList
            </td>
            <td> 
              <a href="@item.Attachment">@item.Attachment</a>
             </td>
            <td>@item.ValidateNote</td>
            <td>@item.DeployNote</td>
            <td>
                @item.demandstate
            </td>
            <td>@item.UpdateTime.ToShortDateString()</td>
            <td>@item.Developer</td>
            <td>
               <div class="btn-group">
                  <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                    操作 <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu" role="menu">

                    @if(Model.IsCanEdit(item))
                    {
                         <li><a href="@Url.Action("itemedit", "checkitem", new { Id = item.ID })">修改</a></li>
                         <li><a href="@Url.Action("deleteitem", "checkitem", new { Id = item.ID })" onclick="return confirm('确定删除?');">删除</a></li>
                    }


                    <li><a href="@Url.Action("itemedit", "checkitem", new { Id = item.ID,act = "view" })">查看</a></li>
                  </ul>
                </div>
             </td>
          </tr>
         }

        </tbody>
      </table>


<div id="pager"><ul class="pagination">@Html.Pager(Model.PageList).ShowIndividualPages(true)</ul> </div>

</form>
</div>

<script type="text/javascript">
    ///全选
    jQuery('#checklist .group-checkable').change(function () {
        var set = jQuery(this).attr("data-set");
        var checked = jQuery(this).is(":checked");
        jQuery(set).each(function () {
            if (checked) {
                $(this).attr("checked", true);
            } else {
                $(this).attr("checked", false);
            }
        });
        jQuery.uniform.update(set);
    });

    //查询
    function query() {
        document.forms[0].action = '@Url.Action("checklist", "checkitem")';
        document.forms[0].method = 'post';
        document.forms[0].submit();
    }


    $(".datefrom").datetimepicker({ format: 'yyyy-mm-dd hh:ii', autoclose: true });
    $(".dateto").datetimepicker({ format: 'yyyy-mm-dd hh:ii', autoclose: true });
</script>

